<style media="screen">
  .ddqy-pop p{
    color:#999;
  }
  .ddAccount-pop .title{
    height: 38px;
    line-height: 38px;
    text-align: left;
  }
  .ddAccount-pop .assignees-container{
    width: 330px;
    height: 420px;
    overflow-y: scroll;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(0,0,0,.25) inset;
    background-color: #fff;
  }
  .select-member-container{
    width:200px;
    height: 420px;
    overflow-y: scroll;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(0,0,0,.25) inset;
    background-color: #fff;
  }
  .ddAccount-pop .assignees-container::-webkit-scrollbar{
    display: none;
  }
  .ddAccount-pop .select-member-container::-webkit-scrollbar{
    display: none;
  }
  .ddAccount-pop .arrow-sign{
    width: 10px;
    margin-right: 12px;
  }
  .ddAccount-pop .select-member-item{
    height: 34px;
    line-height: 34px;
    padding: 0 10px;
  }

</style>


<section id="customer-detail">
  <div class="customer-nav clearfix">
    <ul>
      <li
        v-for="(item, index) in navData"
        :class="{active:item == navActive}"
        @click="navTab(item)"
      >{{item}}</li>
    </ul>
  </div>

  <!-- 客户信息 -->
  <div class="cmr-basis" v-if="navActive == '客户信息'">
    <div class="title">基础信息</div>
    <div class="cmr-outerlayer">
      <div class="dy-flex">
        <div class="dy-fx-1">客户类型：{{cmrData.type | cmrType}}</div>
        <div class="dy-fx-1">客户名称：{{cmrData.name}}</div>
        <div class="dy-fx-1">所属行业：{{cmrData.ityName}}</div>
      </div>
      <div class="dy-flex">
        <div class="dy-fx-1" v-if="cmrData.type === 'QY'">纳税人识别号：{{cmrData.idcode}}</div>
        <div class="dy-fx-1" v-if="cmrData.type === 'PE'">身份证号：{{cmrData.idcode}}</div>
        <div class="dy-fx-1">{{cmrData.type == 'QY' ? '公司' : '个人'}}邮箱：{{cmrData.email | formatUndefine}}</div>
        <div class="dy-fx-1" v-if="!isShowddBtn"></div>
        <div class="dy-fx-1" v-if="isShowddBtn">
          <span style="margin-right:20px;">钉钉账号：{{ddAccount | formatUndefine}}</span>
          <button type="button" class="btn n-btn-outline" @click="changeDDAccount">修改</button>
        </div>
      </div>
      <div class="dy-flex">
        <div class="dy-fx-1">联系人：{{cmrData.lperson | formatUndefine}}</div>
        <div class="dy-fx-1">联系电话：{{cmrData.phone | formatUndefine}}</div>
        <div class="dy-fx-1">获客渠道：{{cmrData.channelType | channelType}}</div>
      </div>
      <div class="dy-flex">
        <div class="dy-fx-1">渠道名称：{{cmrData.channelName || '--'}}</div>
        <div class="dy-fx-1">状态：{{cmrData.customerState | customerState}}</div>
        <div class="dy-fx-1">是否黑名单：{{cmrData.blackState == 'Y' ? '是' : '否'}}</div>
      </div>
      <div class="cmr-memo">客户备注：{{cmrData.memo || '--'}}</div>
    </div>
    <div class="clearfix border-t ptb-10 mt-10">
      <!-- radio -->
      <div class="clearfix" v-for="item in oldTypeArcms.radio" v-if="item.isValid == 'true'">
        <div class="pull-left line-height-34">{{item.displayName}}：</div>
        <div class="pull-left line-height-34">{{item.act}}</div>
      </div>
      <!-- checkbox -->
      <div class="clearfix" v-for="(item, index) in oldTypeArcms.check" v-if="item.isValid == 'true'">
        <div class="pull-left line-height-34">{{item.displayName}}：</div>
        <div class="pull-left line-height-34">{{item.act.join(' ')}}</div>
      </div>
      <!-- input -->
      <div class="clearfix" v-for="(item, index) in oldTypeArcms.input" v-if="item.isValid == 'true'">
        <div class="pull-left line-height-34">{{item.displayName}}：</div>
        <div class="pull-left line-height-34">{{item.act}}</div>
      </div>
      <!-- textarea -->
      <div class="clearfix mt-5" v-for="(item, index) in oldTypeArcms.text" v-if="item.isValid == 'true'">
        <div class="pull-left line-height-34">{{item.displayName}}：</div>
        <div class="pull-left line-height-34">{{item.act}}</div>
      </div>
    </div>

    <div class="cmr-follow-up mt-10">
      <div class="title">跟进记录</div>
      <div class="cmr-follow-content">
        <ul>
          <li class="clearfix" v-for="item in cmrData.records">
            <div class="left">
              <p>{{item.recordDate | formatDate}}</p>
              <p>{{item.operator}}</p>
            </div>
            <div class="line"></div>
            <div class="right">{{item.memo}}</div>
          </li>
        </ul>
      </div>
    </div>
    <div class="cmr-button border-t mt-15 pt-15">
      <hl-button type="primary" @on-click="editCmrFlag = !editCmrFlag">编辑<hl-button>
      <hl-button type="outline" @on-click="followUpFlag = !editCmrFlag">跟进<hl-button>
    </div>
  </div>

  <!-- 意向信息 -->
  <div class="cmr-yxCustomer cmr-basis" v-if="navActive == '意向信息'">
    <!-- 意向列表 -->
    <section v-for="(item,index) in willsList">
      <!-- 展示 -->
      <div v-if="editYxIndex !== index">
        <div class="clearfix">
          <div class="title pull-left">意向信息{{index + 1}}</div>
          <div class="pull-right">
            <button type="button" class="btn s-btn-default mr-10" @click="deleteWill(item.id)">删除</button>
            <button type="button" class="btn s-btn-default" @click="editWill(index)">编辑</button>
          </div>
        </div>
        <div class="cmr-outerlayer">
          <div class="dy-flex">
            <div class="dy-fx-1">需求时间：{{item.xminDate | formatDate}} 至 {{item.xmaxDate | formatDate}}</div>
          </div>
          <div class="dy-flex">
            <div class="dy-fx-1">需求类型：{{item.type == 'ER' ? '整租':'工位'}}</div>
          </div>
          <div class="dy-flex">
            <div class="dy-fx-1" v-if="item.type == 'WR'">需求个数：{{item.wpCount}}个</div>
            <div class="dy-fx-1" v-if="item.type == 'ER'">需求面积：{{item.acreage | formatNum}}m²</div>
          </div>
          <div class="dy-flex">
            <div class="dy-fx-1">需求车位：{{item.stCount}}个</div>
          </div>
          <div class="dy-flex">
            <div class="dy-fx-1">意向项目：{{item.projectName}}</div>
          </div>

          <div v-if="item.type == 'ER' && item.will.unitData.length">
            <div>意向单元:</div>
            <div class="cmr-unit-table hl-table">
              <div class="dy-flex hl-table-th gradient-color">
                <div class="dy-fx-1">楼宇</div>
                <div class="dy-fx-1">楼层</div>
                <div class="dy-fx-1 border-r">单元</div>
              </div>
              <div class="dy-flex hl-table-tb" v-for="(item, index) in item.will.unitData">
                <div class="dy-fx-1">{{item.building_name}}</div>
                <div class="dy-fx-1">{{item.floor_num}}</div>
                <div class="dy-fx-1">{{item.unit_name}}</div>
              </div>
            </div>
          </div>

          <div v-if="item.type == 'WR' && item.will.wpData.length">
            <div>意向工位:</div>
            <div class="cmr-wp-table hl-table">
              <div class="dy-flex hl-table-th gradient-color">
                <div class="dy-fx-4">楼宇</div>
                <div class="dy-fx-1">楼层</div>
                <div class="dy-fx-1">单元</div>
                <div class="dy-fx-1">工位数</div>
                <div class="position-item border-r">工位清单</div>
              </div>
              <div class="dy-flex hl-table-tb content-item" v-for="(item, index) in item.will.wpData">
                <div class="dy-fx-4">{{item.building_name}}</div>
                <div class="dy-fx-1">{{item.floor_num}}</div>
                <div class="dy-fx-1">{{item.unit_name}}</div>
                <div class="dy-fx-1">{{item.positions ? item.positions.length : '0'}}</div>
                <div class="position-item">
                  <span class="position">
                    <b v-for="(item1, index1) in item.positions">
                      {{item1.position_name}}<i v-if=" index1 + 1 !== item.positions.length">、</i>
                    </b>
                  </span>
                </div>
              </div>
            </div>
          </div>

          <div class="sperate-line"></div>
        </div>
      </div>
      <!-- 编辑意向 -->
      <section v-if="editYxFlag && editYxIndex == index">
        <div class="clearfix">
          <div class="title pull-left">意向信息{{index + 1}}</div>
          <div class="pull-right">
            <button type="button" class="btn s-btn-default mr-10" @click="cancelWill">取消</button>
            <button type="button" class="btn s-btn-default" @click="saveWill('edit',item.id)">保存</button>
          </div>
        </div>
        <div class="cmr-outerlayer">
          <div class="row mb-10">
            <div class="col-md-1 pr-0">需求时间:</div>
            <div class="col-md-2">
              <label class="icon-Gm-calendar relative dt-r">
                <input type="text" class="inp bg-fff form-control beginTime" ref="beginTime" readonly
                  placeholder="开始日期" autocomplete="off"/>
              </label>
            </div>
            <div class="cmr-date-line">-</div>
            <div class="col-md-2">
              <label class="icon-Gm-calendar relative dt-r">
                <input type="text" class="inp bg-fff form-control endTime" ref="endTime" readonly
                  placeholder="截止日期" autocomplete="off"/>
              </label>
            </div>
          </div>
          <div class="row mb-10">
            <div class="col-md-1 pr-0">需求类型:</div>
            <div class="col-md-11">
              <span class="hl-radio mr-10" :class="{active:item.type == addWillData.type.active}" :type="item.type" v-for="(item,index) in addWillData.type.list" @click="selectYxType(item.type)">{{item.name}}</span>
            </div>
          </div>
          <div class="row mb-10" v-if="addWillData.type.active == 'ER'">
            <div class="col-md-1 pr-0">需求面积:</div>
            <div class="col-md-1 pr-0">
              <input type="text" class="form-control" v-model="addWillData.acreage">
            </div>
            <div class="col-md-1">m²</div>
          </div>
          <div class="row mb-10" v-if="addWillData.type.active == 'WR'">
            <div class="col-md-1 pr-0">需求个数:</div>
            <div class="col-md-1 pr-0">
              <input type="text" class="form-control" v-model="addWillData.wp_count">
            </div>
            <div class="col-md-1">个</div>
          </div>
          <div class="row mb-10">
            <div class="col-md-1 pr-0">需求车位:</div>
            <div class="col-md-1 pr-0" >
              <input type="text" class="form-control" v-model="addWillData.st_count">
            </div>
            <div class="col-md-1">个</div>
          </div>
          <div class="row mb-10">
            <div class="col-md-1 pr-0">意向项目:</div>
            <div class="col-md-4">
              <div class="select-ul cmr-pro-select">
                <span class="select-name br-4 box-i-shadow">{{addWillData.project_name}}</span>
                <ul>
                  <li
                    v-for="(item, index) in projects.list"
                    @click="getProjectsId(item.projectId, item.projectName)"
                  >{{item.projectName}}</li>
                </ul>
              </div>
            </div>
            <div class="pull-left">
              <button class="btn n-btn-primary"
                      v-if="addWillData.type.active == 'ER'"
                      @click="getBuildings(1)">
                <span class="icon-Org-account mr-10"></span>意向单元
              </button>

              <button class="btn n-btn-primary"
                      v-if="addWillData.type.active == 'WR'"
                      @click="getBuildings(2)">
                <span class="icon-Org-account mr-10"></span>意向工位
              </button>
            </div>
          </div>
          <div v-if="addWillData.type.active == 'ER' && unitData.length">
            <div>意向单元:</div>
            <div class="cmr-unit-table hl-table">
              <div class="dy-flex hl-table-th gradient-color">
                <div class="dy-fx-2">楼宇</div>
                <div class="dy-fx-2">楼层</div>
                <div class="dy-fx-2">单元</div>
                <div class="dy-fx-1 border-r">操作</div>
              </div>
              <div class="dy-flex hl-table-tb" v-for="(item, index) in unitData">
                <div class="dy-fx-2">{{item.building_name}}</div>
                <div class="dy-fx-2">{{item.floor_num}}</div>
                <div class="dy-fx-2">{{item.unit_name}}</div>
                <div class="dy-fx-1">
                    <span class="icon-Gm-delete-2 color-999" @click="deleteUnit(index)"></span>
                </div>
              </div>
            </div>
          </div>
          <div v-if="addWillData.type.active == 'WR' && wpData.length">
            <div>意向工位:</div>
            <div class="cmr-wp-table hl-table">
              <div class="dy-flex hl-table-th gradient-color">
                <div class="dy-fx-4">楼宇</div>
                <div class="dy-fx-1">楼层</div>
                <div class="dy-fx-1">单元</div>
                <div class="dy-fx-1">工位数</div>
                <div class="position-item border-r">工位清单</div>
              </div>
              <div class="dy-flex hl-table-tb content-item" v-for="(item, index) in wpData">
                <div class="dy-fx-4">{{item.building_name}}</div>
                <div class="dy-fx-1">{{item.floor_num}}</div>
                <div class="dy-fx-1">{{item.unit_name}}</div>
                <div class="dy-fx-1">{{item.positions ? item.positions.length : '0'}}</div>
                <div class="position-item">
                  <span class="position">
                    <span v-for="(item, index) in item.positions" @click="delwp(item, index)">
                      {{item.position_name}}
                      <i class="icon-Gm-delete-2"></i>
                    </span>
                  </span>
                </div>
              </div>
            </div>
          </div>
          <div class="sperate-line"></div>
        </div>
      </section>
    </section>

    <!-- 添加意向 -->
    <section v-if="yxFlag">
      <div class="clearfix">
        <div class="title pull-left">意向信息{{addYxIndex}}</div>
        <div class="pull-right">
          <hl-button size="mini" @on-click="cancelWill">取消<hl-button>
          <hl-button size="mini" @on-click="saveWill('add')">保存<hl-button>
        </div>
      </div>
      <div class="cmr-outerlayer">
        <div class="row mb-10">
          <div class="col-md-1 pr-0">需求时间:</div>
          <div class="col-md-2">
            <label class="icon-Gm-calendar relative dt-r">
              <input type="text" class="inp bg-fff form-control beginTime" name="beginTime"  readonly
                placeholder="起始日期" autocomplete="off"/>
            </label>
          </div>
          <div class="cmr-date-line">-</div>
          <div class="col-md-2">
            <label class="icon-Gm-calendar relative dt-r">
              <input type="text" class="inp bg-fff form-control endTime" name="endTime" readonly
                placeholder="截止日期" autocomplete="off"/>
            </label>
          </div>
        </div>
        <div class="row mb-10">
          <div class="col-md-1 pr-0">需求类型:</div>
          <div class="col-md-11">
            <span class="hl-radio mr-10" :class="{active:item.type == addWillData.type.active}" :type="item.type" v-for="(item,index) in addWillData.type.list" @click="selectYxType(item.type)">{{item.name}}</span>
          </div>
        </div>
        <div class="row mb-10" v-if="addWillData.type.active == 'ER'">
          <div class="col-md-1 pr-0">需求面积:</div>
          <div class="col-md-1 pr-0">
            <input type="text" class="form-control" v-model="addWillData.acreage">
          </div>
          <div class="col-md-1">m²</div>
        </div>
        <div class="row mb-10" v-if="addWillData.type.active == 'WR'">
          <div class="col-md-1 pr-0">需求个数:</div>
          <div class="col-md-1 pr-0">
            <input type="text" class="form-control" v-model="addWillData.wp_count">
          </div>
          <div class="col-md-1">个</div>
        </div>
        <div class="row mb-10">
          <div class="col-md-1 pr-0">需求车位:</div>
          <div class="col-md-1 pr-0" >
            <input type="text" class="form-control" v-model="addWillData.st_count">
          </div>
          <div class="col-md-1">个</div>
        </div>
        <div class="row mb-10">
          <div class="col-md-1 pr-0">意向项目:</div>
          <div class="col-md-4">
            <div class="select-ul cmr-pro-select">
              <span class="select-name br-4 box-i-shadow">请选择</span>
              <ul>
                <li
                  v-for="(item, index) in projects.list"
                  @click="getProjectsId(item.projectId, item.projectName)"
                >{{item.projectName}}</li>
              </ul>
            </div>
          </div>
          <div class="pull-left">
            <hl-button icon="icon-Org-account" type="primary" @on-click="getBuildings(1)"   v-if="addWillData.type.active == 'ER'">意向单元</hl-button>

            <button class="btn n-btn-primary"
                    v-if="addWillData.type.active == 'WR'"
                    @click="getBuildings(2)">
              <span class="icon-Org-account mr-10"></span>意向工位
            </button>
          </div>
        </div>
        <!-- 意向单元 -->
        <div v-if="addWillData.type.active == 'ER' && unitData.length">
          <div>意向单元:</div>
          <div class="cmr-unit-table hl-table">
            <div class="dy-flex hl-table-th gradient-color">
              <div class="dy-fx-2">楼宇</div>
              <div class="dy-fx-2">楼层</div>
              <div class="dy-fx-2">单元</div>
              <div class="dy-fx-1 border-r">操作</div>
            </div>
            <div class="dy-flex hl-table-tb" v-for="(item, index) in unitData">
              <div class="dy-fx-2">{{item.building_name}}</div>
              <div class="dy-fx-2">{{item.floor_num}}</div>
              <div class="dy-fx-2">{{item.unit_name}}</div>
              <div class="dy-fx-1">
                  <span class="icon-Gm-delete-2 color-999" @click="deleteUnit(index)"></span>
              </div>
            </div>
          </div>
        </div>
        <!-- 意向工位 -->
        <div v-if="addWillData.type.active == 'WR' && wpData.length">
          <div>意向工位:</div>
          <div class="cmr-wp-table hl-table">
            <div class="dy-flex hl-table-th gradient-color">
              <div class="dy-fx-4">楼宇</div>
              <div class="dy-fx-1">楼层</div>
              <div class="dy-fx-1">单元</div>
              <div class="dy-fx-1">工位数</div>
              <div class="position-item border-r">工位清单</div>
            </div>
            <div class="dy-flex hl-table-tb content-item" v-for="(item, index) in wpData">
              <div class="dy-fx-4">{{item.building_name}}</div>
              <div class="dy-fx-1">{{item.floor_num}}</div>
              <div class="dy-fx-1">{{item.unit_name}}</div>
              <div class="dy-fx-1">{{item.positions ? item.positions.length : '0'}}</div>
              <div class="position-item">
                <span class="position">
                  <span v-for="(item, index) in item.positions" @click="delwp(item, index)">
                    {{item.position_name}}
                    <i class="icon-Gm-delete-2"></i>
                  </span>
                </span>
              </div>
            </div>
          </div>
        </div>


        <div class="sperate-line"></div>
      </div>
    </section>
    <button type="button" class="btn n-btn-primary" @click="addWill">添加意向</button>
  </div>

  <!-- 关联合同 -->
  <div class="cmr-associated" v-if="navActive == '关联合同'">
    <div class="box-i-shadow-2 br-4">
      <div class="dy-flex">
        <div class="dy-fx-1">序</div>
        <div class="dy-fx-2">合同编号</div>
        <div class="dy-fx-2">签订时间</div>
        <div class="dy-fx-2">记租时间</div>
        <div class="dy-fx-2">到期时间</div>
        <div class="dy-fx-2">状态</div>
        <div class="dy-fx-2">签订人</div>
      </div>
      <div class="dy-flex border-t" v-for="(item, index) in associateData">
        <div class="dy-fx-1">{{(index+1) < 10 ? '0'+(index+1) : index}}</div>
        <div class="dy-fx-2 cutoff"><a :href="'#/contractNewDeatil?id=' +item.id+'&ddtab=true'" target="_blank">{{item.cCode}}</a></div>
        <div class="dy-fx-2">{{item.signTime | formatDate}}</div>
        <div class="dy-fx-2">{{item.beginDate | formatDate}}</div>
        <div class="dy-fx-2">{{item.endDate | formatDate}}</div>
        <div class="dy-fx-2">{{item.auditState | auditState}}</div>
        <div class="dy-fx-2">{{item.sperson}}</div>
      </div>
    </div>
  </div>
  
  <!-- 编辑客户 -->
  <div class="backdrop" v-if="editCmrFlag"></div>
  <div class="pop box-o-shadow" v-if="editCmrFlag">
    <div class="head-pop font-16"><span class="">编辑客户</span>
      <button class="fw-close absolute" @click="editCmrFlag = !editCmrFlag">×</button>
    </div>
    <div class="content-pop js-content-scroll border-b plr-24">
      <div class="row">
        <div class="col-md-2 line-height-34"><span class="required">*</span>客户类型：</div>
        <div class="col-md-6 pl-0 js-type-user">
          <button
            :class="{'js-select-radio':true, 'select-active':item.type == cmrDataAt.type, 'line-height-34':true}"
            v-for="(item, index) in cmrType"
            @click="setcmrDataAtType(item.type)"
          >{{item.name}}</button>
        </div>
      </div>
      <div class="row mt-10">
        <div class="col-md-2 line-height-34"><span class="required">*</span>客户名称：</div>
        <div class="col-md-4 pl-0">
          <input
            type="text"
            class="form-control box-i-shadow"
            autocomplete="off"
            v-model="cmrDataAt.name"
          />
        </div>
        <div class="col-md-2 line-height-34"><span class="required">*</span>所属行业：</div>
        <div class="col-md-4 pl-0">
          <div class="select-ul">
            <span class="select-name js-industry br-4 box-i-shadow">{{cmrDataAt.ityName}}</span>
            <ul class="js-type-append">
              <li v-for="item in getTypeData" @click="setindustryType(item.code)">{{item.name}}</li>
            </ul>
          </div>
        </div>
      </div>

      <!-- 公司 -->
      <div class="row mt-10" v-if="cmrDataAt.type === 'QY'">
        <div class="col-md-2 line-height-34 pr-0"><span class="no-required"></span>纳税人识别号：</div>
        <div class="col-md-4 pl-0">
          <input
            type="text"
            class="form-control js-linkman box-i-shadow airVal"
            autocomplete="off"
            v-model="cmrDataAt.idcode"
          />
        </div>
        <div class="col-md-2 line-height-34"><span class="no-required"></span>公司邮箱：</div>
        <div class="col-md-4 pl-0">
          <input
            type="text"
            class="form-control js-phone box-i-shadow airVal"
            autocomplete="off"
            v-model="cmrDataAt.email"
          />
        </div>
      </div>

      <!-- 个人 -->
      <div class="row mt-10" v-if="cmrDataAt.type === 'PE'">
        <div class="col-md-2 line-height-34"><span class="no-required"></span>身份证号：</div>
        <div class="col-md-4 pl-0">
          <input
            type="text"
            class="form-control js-linkman box-i-shadow airVal"
            autocomplete="off"
            v-model="cmrDataAt.idcode"
          />
        </div>
        <div class="col-md-2 line-height-34"><span class="no-required"></span>个人邮箱：</div>
        <div class="col-md-4 pl-0">
          <input
            type="text"
            class="form-control js-phone box-i-shadow airVal"
            autocomplete="off"
            v-model="cmrDataAt.email"
          />
        </div>
      </div>
      <div class="row mt-10">
        <div class="col-md-2 line-height-34"><span class="no-required"></span>联系人：</div>
        <div class="col-md-4 pl-0">
          <input
            type="text"
            class="form-control js-linkman box-i-shadow airVal"
            autocomplete="off"
            v-model="cmrDataAt.lperson"
          />
        </div>
        <div class="col-md-2 line-height-34"><span class="no-required"></span>联系电话：</div>
        <div class="col-md-4 pl-0">
          <input
            type="text"
            class="form-control js-phone box-i-shadow airVal"
            autocomplete="off"
            v-model="cmrDataAt.phone"
          />
        </div>
      </div>
      <div class="row mt-10">
        <div class="col-md-2 line-height-34"><span class="required">*</span>获取渠道：</div>
        <div class="col-md-4 pl-0">
          <div class="select-ul accessTo bg-fff">
            <span class="select-name js-channel br-4 box-i-shadow">{{cmrDataAt.channelType | channelType}}</span>
            <ul>
              <li v-for="item in getChannel" @click="setchannelType(item.type)">{{item.name}}</li>
            </ul>
          </div>
        </div>
        <div class="col-md-2 line-height-34"><span class="no-required"></span>渠道名称：</div>
        <div class="col-md-4 pl-0">
          <input
            type="text"
            class="form-control airVal box-i-shadow"
            autocomplete="off"
            v-model="cmrDataAt.channelName"
          />
        </div>
      </div>

      <div class="row mt-10">
        <div class="col-md-2 line-height-34"><span class="required">*</span>状态：</div>
        <div class="col-md-4 pl-0">
          <div class="select-ul accessTo bg-fff">
            <span class="select-name br-4 js-type-pylc box-i-shadow">{{cmrDataAt.customerState | customerState}}</span>
            <ul>
              <li v-for="item in customerStateAt" @click="setcustomerState(item.type)">{{item.name}}</li>
            </ul>
          </div>

        </div>
        <div class="col-md-2 line-height-34"><span class="required">*</span>是否黑名单：</div>
        <div class="col-md-4 pl-0 js-black-d">
          <button
            :class="{'js-select-radio':true, 'line-height-34':true, 'select-active': item.type == cmrDataAt.blackState}"
            v-for="item in blacklist"
            @click="setblackState(item.type)"
          >{{item.name}}</button>
        </div>
      </div>
      <div class="row mt-10 mb-10">
        <div class="col-md-2"><span class="no-required"></span>客户备注：</div>
        <div class="col-md-10 pl-0">
          <textarea
            class="form-control box-i-shadow"
            rows="3"
            autocomplete="off"
            v-model="cmrDataAt.memo"
          ></textarea>
        </div>
      </div>
      <div class="clearfix border-t ptb-10 mt-10">
        <!-- radio -->
        <div class="clearfix" v-for="item in typeArcms.radio" v-if="item.isValid == 'true'">
          <div class="pull-left mr-24 line-height-34" style="width: 95px;"><span style="margin-left:-5px;" v-if="item.isRequired == 'true'" class="required">*</span>{{item.displayName}}：</div>
          <div class="pull-left">
            <ul class="cr-type-select clearfix">
              <li :class="{active: item1 == item.act}" v-for="item1 in item.fieldRange.split(',')" @click="item.act = item1">{{item1}}</li>
            </ul>
          </div>
        </div>
        <!-- checkbox -->
        <div class="clearfix" v-for="(item, index) in typeArcms.check" v-if="item.isValid == 'true'">
          <div class="pull-left mr-24 line-height-34" style="width: 95px;"><span v-if="item.isRequired == 'true'" class="required" style="margin-left:-5px;">*</span>{{item.displayName}}：</div>
          <div class="pull-left" style="margin-left:22px;">
            <span
              style="line-height: 32px;"
              :class="{'js-set': true, 'js-q-active': item.act.indexOf(item1) > -1}"
              @click="checkRadio(index, item1)"
              v-for="item1 in item.fieldRange.split(',')">{{item1}}</span>
          </div>
        </div>
        <!-- input -->
        <div class="clearfix mt-5" v-for="(item, index) in typeArcms.input" v-if="item.isValid == 'true'">
          <div class="pull-left mr-24 line-height-34" style="width: 95px;"><span v-if="item.isRequired == 'true'" class="required" style="margin-left:-5px;">*</span>{{item.displayName}}：</div>
          <div class="pull-left"><input type="text" class="form-control box-i-shadow" v-model="item.act"></div>
        </div>
        <!-- textarea -->
        <div class="clearfix mt-5" v-for="(item, index) in typeArcms.text" v-if="item.isValid == 'true'">
          <div class="pull-left mr-24 line-height-34" style="width: 95px;"><span style="margin-left:-5px;" v-if="item.isRequired == 'true'" class="required">*</span>{{item.displayName}}：</div>
          <div class="pull-left"><textarea style="min-width: 500px; max-width: 600px; height: 120px;" class="form-control box-i-shadow" v-model="item.act"></textarea></div>
        </div>
      </div>
    </div>
    <div class="back-contract text-center ptb-10 js-back-content">
      <button class="n-btn-primary br-4 mr-10" @click="saveCosumter">保存</button>
      <button class="n-btn-outline br-4" @click="backCmr">返回</button>
    </div>
  </div>

  <!-- //跟进 -->
  <div class="backdrop" v-if="followUpFlag"></div>
  <div class="follow-up-pop" v-if="followUpFlag">
    <div class="title">新增跟进</div>
    <button class="fw-close absolute" @click="followUpFlag = !followUpFlag">×</button>
    <div class="content">
      <div class="dy-flex">
        <div class="dy-fx-1"><span class="required">*</span>跟进时间</div>
        <div class="dy-fx-5">
          <label class="icon-Gm-calendar relative dt-r">
            <input type="text" class="inp bg-fff form-control" name="beginTime" readonly placeholder="起始日期" id="Sdate"/>
          </label>
        </div>
      </div>
      <div class="dy-flex mt-15">
        <div class="dy-fx-1"><span class="required">*</span>跟进记录</div>
        <div class="dy-fx-5">
          <textarea class="form-control" v-model="followData"></textarea>
        </div>
      </div>
    </div>
    <div class="back-contract text-center ptb-10 js-back-content">
      <button class="n-btn-primary br-4" @click="postFollow">提交跟进记录</button>
      <button class="n-btn-outline br-4" @click="backFollow">返回</button>
    </div>
  </div>
  <!-- 企业绑定 -->
  <div class="pop box-o-shadow ddqy-pop" v-show="isShowQyLayer" style="width:600px;">
    <div class="head-pop font-16"><span>企业绑定</span>
      <button class="fw-close absolute close" type="button" @click="closeQyLayer">×</button>
    </div>
    <div class="content-pop">
      <div class="content" style="padding:40px 45px;">
        <div style="margin-bottom:20px;">
          <div class="dy-flex mb-10">
            <div class="dy-fx-1 line-height-34 ">CorpId:</div>
            <div class="dy-fx-3">
              <input type="text" class="form-control corpId-ipt" v-model="corpId" style="width:200px;" @blur="validateCorpId">
            </div>
          </div>
          <div class="dy-flex">
            <div class="dy-fx-1 line-height-34 ">CorpSecret:</div>
            <div class="dy-fx-3">
              <input type="text" class="form-control corpSecret-ipt" v-model="corpSecret" style="width:200px;" @blur="validateCorpSecret">
            </div>
          </div>
        </div>

        <p style="margin-bottom:20px;">以上内容将用于同步用户到系统以及后续的消息通知与账号免登录，获取步骤如下:</p>
        <p>1.钉钉主管理员在电脑访问https://open-dev.dingtalk.com/。</p>
        <p>2.进入“应用开发”-“开发账号管理”菜单。</p>
        <p>3.页面右侧“企业接口调用CorpSecret”中的数据即为当前所需。</p>
      </div>
    </div>
    <div class="fw-button">
      <button type="button" class="fw-submit yes mr-10" @click="confirmBindQy">确认</button>
      <button type="button" class="fw-submit no" @click="closeQyLayer">取消</button>
    </div>
  </div>
  <!-- 账号绑定 -->
  <div class="pop box-o-shadow ddAccount-pop" v-show="isShowAccountLayer" style="width:680px;">
    <div class="head-pop font-16"><span>账号绑定</span>
      <button class="fw-close absolute close" type="button" @click="closeAccountLayer">×</button>
    </div>
    <div class="content-pop">
      <div class="content clearfix" style="padding:0px 45px 30px;">
        <div class="pull-left">
          <p class="title">可选账号</p>
          <div class="assignees-container">
            <ul class="main assignees-wrapper">
                <li>
                  <div class="item item-1" data-id="item.id" data-type="item.type">
                    <span class="hl-icon icon-GM－open arrow-sign"></span>
                    <span class="assignees-checkbox"></span>
                    <i class="name"></i>
                  </div>
                  <ul></ul>
                </li>
            </ul>
          </div>
        </div>

        <div class="pull-right">
          <p class="title">已选账号</p>
          <div class="select-member-container">
            <ul class="select-member-wrap">
              <li></li>
            </ul>
          </div>
        </div>
      </div>
    </div>
    <div class="fw-button">
      <button type="button" class="fw-submit yes mr-10" @click="confirmBindAccount">确认</button>
      <button type="button" class="fw-submit no" @click="closeAccountLayer">取消</button>
    </div>
  </div>
  <!-- 添加单元弹出层 -->
  <section class="pop" v-if="bounced.unitFlag">
    <div class="head-pop font-16"><span class="title">添加单元</span>
      <button class="fw-close absolute" @click="closeAddUnitPop">×</button>
    </div>
    <div class="content border-b">
      <!-- 选择容器 -->
      <div class="clearfix select-row">
        <div class="pull-left clearfix">
          <div class="pull-left hl-34 mr-10">选择楼宇:</div>
          <div class="pull-left building-select unit-name">
            <div class="select-ul">
              <span class="select-name br-4 box-i-shadow">请选择</span>
              <ul>
                <li v-for="item in projects.builddata" @click="getBuildId(item.buildingId, item.names)">{{item.names}}</li>
              </ul>
            </div>
          </div>
        </div>
        <div class="pull-left clearfix">
          <div class="pull-left hl-34 mlr-10">选择楼层:</div>
          <div class="pull-left floor-select">
            <div class="select-ul">
              <span class="select-name br-4 box-i-shadow">请选择</span>
              <ul>
                <li
                  v-for="(item, index) in projects.floorsdata"
                  @click="getUnits(item.floorId, item.floorName)"
                >{{item.floorName}}</li>
              </ul>
            </div>
          </div>
        </div>
        <button class="btn n-btn-default mlr-10" @click="queryUnit">查询</button>
      </div>
      <!-- 内容 -->
      <div class="clearfix table">
        <div class="tb-title clearfix pull-left" style="width:62px;">
          <div class="last-unit">单元</div>
        </div>
        <ul class="tb-content pull-left" style="width:706px;">
          <li class="tb-item clearfix pt-10" v-if="projects.unitdata.length > 0">
            <div class="last-unit unit-active">
              <span
                v-for="(item, index) in projects.unitdata"
                @click="selUnit($event, index, item.unitId)"
                :data-unitId="item.unitId"
                v-if="item.unitType == 'BU' && item.rentState != 'ZY'"
              >
                {{item.unitName.length > 9 ? item.unitName.substr(0,8)+'...' : item.unitName}}
                <i class="icon-Nav-contract-choice selected-icon"></i>
              </span>
            </div>
          </li>
        </ul>
      </div>
    </div>
    <div class="button-container ptb-10 text-center">
      <button class="btn n-btn-primary" @click="confirmAddUnitsOrWp(1)">确认添加</button>
    </div>
  </section>
  <!-- 添加工位弹出层 -->
  <section class="pop" v-if="bounced.wpFlag">
    <div class="head-pop font-16"><span class="title">添加工位</span>
      <button class="fw-close absolute" @click="closeAddwpPop">×</button>
    </div>
    <div class="content border-b">
      <!-- 选择容器 -->
      <div class="clearfix select-row">
        <div class="pull-left clearfix">
          <div class="pull-left hl-34 mr-10">楼宇:</div>
          <div class="pull-left building-select">
            <div class="select-ul">
              <span class="select-name br-4 box-i-shadow">请选择</span>
              <ul>
                <li v-for="item in projects.builddata" @click="getBuildId(item.buildingId, item.names)">{{item.names}}</li>
              </ul>
            </div>
          </div>
        </div>
        <div class="pull-left clearfix">
          <div class="pull-left hl-34 mlr-10">楼层:</div>
          <div class="pull-left floor-select">
            <div class="select-ul">
              <span class="select-name br-4 box-i-shadow">请选择</span>
              <ul>
                <li
                  v-for="(item, index) in projects.floorsdata"
                  @click="getStWpUnitsList(item.floorId, item.floorName)"
                >{{item.floorName}}</li>
              </ul>
            </div>
          </div>
        </div>
        <div class="pull-left clearfix">
          <div class="pull-left hl-34 mlr-10">单元:</div>
          <div class="pull-left unit-select">
            <div class="select-ul">
              <span class="select-name br-4 box-i-shadow">请选择</span>
              <ul>
                <li
                  v-for="(item, index) in projects.unitdata"
                  v-if="item.unitType == 'WP'"
                  @click="getWp(item.unitId, item.unitName, index)"
                >{{item.unitName}}</li>
              </ul>
            </div>
          </div>
        </div>
        <button class="btn n-btn-default mlr-10">查询</button>
      </div>
      <!-- 内容 -->
      <div class="clearfix table">
        <div class="tb-title clearfix pull-left" style="width:62px;">
          <div class="position">工位</div>
        </div>
        <ul class="tb-content pull-left" style="width:706px;">
          <li class="tb-item clearfix pt-10">
            <div class="position st-unit wp-list">
              <span v-for="(item, index) in projects.stWpdata" @click.prevent="selectWp($event, index, item.positionId, item.positionName)" :data-posId="item.positionId" v-if="item.rentState != 'ZY'">
                {{item.positionName.length > 9 ? item.positionName.substr(0,8)+'...' : item.positionName}}
                <i class="icon-Nav-contract-choice selected-icon"></i>
              </span>
            </div>
          </li>
        </ul>
      </div>
    </div>
    <div class="button-container ptb-10 text-center">
      <button class="btn n-btn-primary" @click="confirmAddUnitsOrWp(2)">确认添加</button>
    </div>
  </section>
  <div class="backdrop" v-if="bounced.unitFlag"></div>
  <div class="backdrop" v-if="bounced.wpFlag"></div>
  <div class="backdrop" v-show="isShowQyLayer"></div>
  <div class="backdrop" v-show="isShowAccountLayer"></div>


</section>

<script src="modules/customer/scripts/dd_account.js" charset="utf-8"></script>
<script src="modules/customer/scripts/customerDetail.js" charset="utf-8"></script>
